<!DOCTYPE html>

<html class="no-js">

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title></title>
  <meta name="description" content="" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <script src="https://cdn.staticfile.org/axios/0.19.0-beta.1/axios.js"></script>
  <script src="https://cdn.staticfile.org/vue/2.5.17/vue.js"></script>
  <link rel="stylesheet" href="../../cdn/element-ui/theme-chalk/index.css" />
  <script src="../../cdn/element-ui/index.js"></script>
  <link rel="stylesheet" href="../../../lib/index.css" />
  <script src="../../../lib/avue.js"></script>
</head>

<body>
  <div id="app">

    <el-button plain @click="showDialog"> 弹窗页面</el-button>
    <el-button plain @click="showDialog1"> 弹窗页面（带上数据）</el-button>
  </div>
</body>
<script>
  new Vue({
    el: '#app',
    data() {
      return {
        option: {
          labelWidth: 150,
          formHeight: 200,
          submitText: '完成',
          column: [
            {
              label: "房产证号",
              prop: "name1",
              suffixIcon: 'el-icon-tickets',
              prefixIcon: 'el-icon-tickets',
              rules: [{
                required: true,
                message: "请输入部门名称",
                trigger: "blur"
              }],
            },

            {
              label: "土地来源",
              prop: "type",
              type: "select",


            },
            {
              label: "是否有配偶",
              prop: "grade1",
              type: "checkbox",
            },
            {
              label: "证件类型",
              prop: "idType",
              type: "select",

            },
            {
              label: "证件号码",
              prop: "idNumber",

              rules: [{
                required: true,
                message: "请输入证件号",
                trigger: "blur"
              }],
            },
            {
              label: "姓名",
              prop: "customerName",
              mock: {
                type: 'name'
              },
            },
            {
              label: "出生日期",
              prop: "dat3e",
              type: "date",
              format: 'yyyy-MM-dd',
              valueFormat: 'yyyy-MM-dd',
              mock: {
                type: 'datetime',
                format: 'yyyy-MM-dd'
              },
            },
            {
              label: "手机号",


              prop: "tel",
              type: 'input'
            },
            {
              label: "配偶是否共有人",
              prop: "grad2e1",
              type: "checkbox",

            },
            {
              label: "是否有其他共有人",
              prop: "gr2ad2e1",
              type: "checkbox",

            }

          ]
        },
        form: {}
      }
    },
    methods: {
      showDialog() {
        this.$DialogForm.show({
          title: '弹窗页面',
          width: '80%',
          option: this.option,
          beforeClose: () => {
            this.$message.success('关闭前方法')
          },
        }).then(res => {
          console.log(res.data);
          this.$message.success('关闭等待框')
          setTimeout(() => {
            res.done()
            setTimeout(() => {
              this.$message.success('关闭弹窗')
              res.close()
            }, 1000)
          }, 1000)
        });

      },
      showDialog1() {
        this.$DialogForm.show({
          title: '弹窗页面（带上数据)',
          width: '50%',
          data: { name1: '测试数据' },
          option: this.option
        }).then(res => {
          console.log(res.data);
          this.$message.success('关闭等待框')
          setTimeout(() => {
            res.done()
            setTimeout(() => {
              this.$message.success('关闭弹窗')
              res.close()
            }, 1000)
          }, 1000)
        });
      }
    }
  })
</script>

</html>